﻿//
// RSDEntities.IObjectContext.cs
//
// Authors:
//    Claus Jørgensen <10229@iha.dk>
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Diagnostics.Contracts;

namespace RSD.Data
{
    public partial class RSDEntities : IObjectContext
    {
        #region IObjectContext Members

        /// <summary>
        /// Creates a new <see cref="T:IObjectSet"/> instance that is used
        /// to query, add, modify, and delete objects of the specified entity type.
        /// </summary>
        /// <typeparam name="TEntity">Entity type of the requested <see cref="T:IObjectSet"/>.</typeparam>
        /// <returns>
        /// The new <see cref="T:IObjectSet"/> instance.
        /// </returns>
        public new IObjectSet<TEntity> CreateObjectSet<TEntity>()
            where TEntity : class
        {
            return base.CreateObjectSet<TEntity>();
        }

        /// <summary>
        /// Persists all updates to the data source and resets change tracking in the object context.
        /// </summary>
        /// <returns>
        /// The number of objects in an <see cref="F:System.Data.EntityState.Added"/>, 
        /// <see cref="F:System.Data.EntityState.Modified"/>, 
        /// or <see cref="F:System.Data.EntityState.Deleted"/> state when 
        /// <see cref="M:System.Data.Objects.ObjectContext.SaveChanges"/> was called.
        /// </returns>
        /// <exception cref="T:System.Data.OptimisticConcurrencyException">
        /// An optimistic concurrency violation has occurred in the data source.</exception>
        public new int SaveChanges()
        {
            return base.SaveChanges();
        }

        #endregion
    }
}
